package choose.student1;

public class Class {
    private int classnum;
    private int stunum;
    private int groupnum;
    private Group[] totalgroups;
    public Class(int classnum,int stunum){
        this.classnum=classnum;
        this.stunum=stunum;
        if(stunum%2==0){
            this.groupnum=stunum/2;
        }
        else{
            this.groupnum=(stunum+1)/2;
        }
        this.totalgroups=new Group[groupnum];
    }

    public void addgroup(Group group){
        for(int i=0;i< totalgroups.length;i++){
            if(totalgroups[i]==null){
                totalgroups[i]=group;
                break;
            }
        }
    }
    public Group[] getTotalgroups() {
        return totalgroups;
    }

    public int getClassnum() {
        return classnum;
    }
}
